{template 'common/header'}
<ul class="nav nav-tabs">
    <li class="active"><a href="{php echo $this->createWebUrl('notice', array('op' => 'add'));}">设置通知</a></li>
    <li><a href="{php echo $this->createWebUrl('notice', array('op' => 'list'));}">通知管理</a></li>
</ul>
<form action="" class="form-horizontal" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="{$item['id']}">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">设置通知</h3>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <label for="title" class="col-sm-2 control-label">粉丝OPENID</label>
                <div class="col-sm-4">
                    <!-- <select name='fansopenid' class="form-control">
                        {loop $members $member}
                        <option value='{$member['openid']}'>{$member['realname']}</option>
                        {/loop}
                    </select> -->
                    <input type='text' name='fansopenid' id='fansopenid' class="form-control" value="{$item['fansopenid']}" placeHolder="请输入粉丝openid"/>
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">通知方式</label>
                <div class="col-sm-10">
                    <label for="type1" class="radio-inline">
                        <input type="radio" name="type" value="1" id="type1" {if $item['type']==1 || empty($item['type'])}checked="true" {/if}/>模板消息通知</label>
                    &nbsp;&nbsp;&nbsp;
                    <label for="type2" class="radio-inline">
                        <input type="radio" name="type" value="2" id="type2" {if $item['type']==2}checked="true" {/if}/>短信通知</label>
                    <label for="type3" class="radio-inline">
                        <input type="radio" name="type" value="3" id="type3" {if $item['type']==3}checked="true" {/if}/>全部通知</label>
    
                </div>
            </div>
            <div>
                <div class="form-group">
                    <label for="title" class="col-sm-2 control-label">报修是否启用</label>
                    <div class="col-sm-4">
                        <label class="radio-inline">
                            <input type="radio" name="repair_status" id="" value="2" {if $item['repair_status']==2 || empty($item['repair_status'])}checked="checked" {/if}> 是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="repair_status" id="" value="1" {if $item['repair_status']==1 }checked="checked" {/if}> 否
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="title" class="col-sm-2 control-label">投诉是否启用</label>
                    <div class="col-sm-4">
                        <label class="radio-inline">
                            <input type="radio" name="report_status" id="" value="2" {if $item['report_status']==2 || empty($item['report_status'])}checked="checked" {/if}> 是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="report_status" id="" value="1" {if $item['report_status']==1 }checked="checked" {/if}> 否
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="shopping_status" class="col-sm-2 control-label">超市订单提醒是否启用</label>
                    <div class="col-sm-4">
                        <label class="radio-inline">
                            <input type="radio" name="shopping_status" id="" value="2" {if $item['shopping_status']==2 || empty($item['shopping_status'])}checked="checked" {/if}> 是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="shopping_status" id="" value="1" {if $item['shopping_status']==1 }checked="checked" {/if}> 否
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="shopping_status" class="col-sm-2 control-label">客户预约通知是否启用</label>
                    <div class="col-sm-4">
                        <label class="radio-inline">
                            <input type="radio" name="homemaking_status" id="" value="2" {if $item['homemaking_status']==2 || empty($item['homemaking_status'])}checked="checked" {/if}> 是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="homemaking_status" id="" value="1" {if $item['homemaking_status']==1 }checked="checked" {/if}> 否
                        </label>
                    </div>
                </div>
                 {if !$user['regionid']}
                <div class="form-group">
                        <label for="" class="col-sm-2 control-label">选择小区</label>
                        <div class="col-sm-10">
                            <label class="checkbox-inline">  
                                <input type="checkbox" id="checkAll" name="checkAll" data-group="regionid">全部
                            </label>
                          {loop $regions $region}
                            <label class="checkbox-inline">
                              <input type="checkbox" id="regionid" value="{$region['id']}" name='regionid[]' data-group ="regionid" {if @in_array($region['id'], $regs)}checked='checked' {/if}> {$region['city']}{$region['dist']}{$region['title']}
                            </label>
                          {/loop}
                        </div>
                    </div>
                {/if}  
                <div class="form-group">
                    <label for="" class="col-sm-2 control-label"></label>
                    <div class="col-sm-10">
                        <button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
                        <input type="hidden" name="token" value="{$_W['token']}" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript">
    $(function() {
             $("#checkAll").click(function() {

                    var checked = $(this).get(0).checked;
                    var group = $(this).data('group');
                    $("#regionid[data-group='" +group + "']").each(function(){
                        $(this).get(0).checked = checked;
                    })

             });
        });
</script>
{template 'common/footer'}
